.\" vim:ft=nroff:
.\" The contents of this file are subject to the Mozilla Public License
.\" Version 1.1 (the "License"); you may not use this file except in
.\" compliance with the License. You may obtain a copy of the License
.\" at https://www.mozilla.org/MPL/
.\"
.\" Software distributed under the License is distributed on an "AS IS"
.\" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
.\" the License for the specific language governing rights and
.\" limitations under the License.
.\"
.\" The Original Code is RabbitMQ.
.\"
.\" The Initial Developer of the Original Code is Pivotal Software, Inc.
.\" Copyright (c) 2007-2019 Pivotal Software, Inc.  All rights reserved.
.\"
.Dd September 28, 2019
.Dt RABBITMQ-SERVICE.BAT 8
.Os "RabbitMQ Server"
.Sh NAME
.Nm rabbitmq-service.bat
.Nd tool for managing RabbitMQ Windows service
.\" ------------------------------------------------------------------
.Sh SYNOPSIS
.\" ------------------------------------------------------------------
.Nm
.Op Ar command
.\" ------------------------------------------------------------------
.Sh DESCRIPTION
.\" ------------------------------------------------------------------
RabbitMQ is an open source multi-protocol messaging broker.
.Pp
Running
.Nm
allows the RabbitMQ broker to be run as a service in
Windows® environments.
The RabbitMQ broker service can be started and stopped using the
Windows® services panel.
.Pp
By default the service will run in the authentication context of the
local system account.
It is therefore necessary to synchronise Erlang cookies between the
local system account (typically
.Pa C:\(rsWindows\(rs.erlang.cookie
and the account that will be used to run
.Xr rabbitmqctl 8 .
.\" ------------------------------------------------------------------
.Sh COMMANDS
.\" ------------------------------------------------------------------
.Bl -tag -width Ds
.It Cm help
Display usage information.
.It Cm install
Install the service.
The service will not be started.
Subsequent invocations will update the service parameters if relevant
environment variables were modified.
.It Cm remove
Remove the service.
If the service is running then it will automatically be stopped before
being removed.
No files will be deleted as a consequence and
.Xr rabbitmq-server 8
will remain operable.
.It Cm start
Start the service.
The service must have been correctly installed beforehand.
.It Cm stop
Stop the service.
The service must be running for this command to have any effect.
.It Cm disable
Disable the service.
This is the equivalent of setting the startup type to
.Sy Disabled
using the service control panel.
.It Cm enable
Enable the service.
This is the equivalent of setting the startup type to
.Sy Automatic
using the service control panel.
.El
.\" ------------------------------------------------------------------
.Sh ENVIRONMENT
.\" ------------------------------------------------------------------
.Bl -tag -width Ds
.It Ev RABBITMQ_SERVICENAME
Defaults to RabbitMQ.
.It Ev RABBITMQ_BASE
Note: Windows only. Defaults to the application data directory of the
current user. This is the location of log and database directories.
.It Ev RABBITMQ_NODENAME
Defaults to
.Qq rabbit@ .
followed by the computed hostname.
Can be used to run multiple nodes on the same host.
Every node in a cluster must have a unique
.Ev RABBITMQ_NODENAME
To learn more, see the
.Lk https://www.rabbitmq.com/clustering.html "RabbitMQ Clustering guide"
.It Ev RABBITMQ_NODE_IP_ADDRESS
By default RabbitMQ will bind to all IPv6 and IPv4 interfaces available.
This variable limits the node to one network interface or address
family.
To learn more, see the
.Lk https://www.rabbitmq.com/networking.html "RabbitMQ Networking guide"
.It Ev RABBITMQ_NODE_PORT
AMQP 0-9-1 and AMQP 1.0 port. Defaults to 5672.
To learn more, see the
.Lk https://www.rabbitmq.com/networking.html "RabbitMQ Networking guide"
.It Ev ERLANG_SERVICE_MANAGER_PATH
Defaults to
.Pa C:\(rsProgram\ Files\(rserl{version}\(rserts-{version}\(rsbin
(or
.Pa C:\(rsProgram\ Files\ (x86)\(rserl{version}\(rserts-{version}\(rsbin
for 64-bit environments).
This is the installation location of the Erlang service manager.
.It Ev RABBITMQ_CONSOLE_LOG
Set this variable to
.Sy new or
.Sy reuse
to have the console output from the server redirected to a file named
.Pa SERVICENAME.debug
in the application data directory of the user that installed the
service.
Under Vista this will be
.Pa C:\(rsUsers\(rsAppData\(rsusername\(rsSERVICENAME .
Under previous versions of Windows this will be
.Pa C:\(rsDocuments and Settings\(rsusername\(rsApplication Data\(rsSERVICENAME .
If
.Ev RABBITMQ_CONSOLE_LOG
is set to
.Sy new
then a new file will be created each time the service starts.
If
.Ev RABBITMQ_CONSOLE_LOG
is set to
.Sy reuse
then the file will be overwritten each time the service starts.
The default behaviour when
.Ev RABBITMQ_CONSOLE_LOG
is not set or set to a value other than
.Sy new
or
.Sy reuse
is to discard the server output.
.El
.\" ------------------------------------------------------------------
.Sh SEE ALSO
.\" ------------------------------------------------------------------
.Xr rabbitmqctl 8 ,
.Xr rabbitmq-diagnostics 8 ,
.Xr rabbitmq-plugins 8 ,
.Xr rabbitmq-server 8 ,
.Xr rabbitmq-queues 8 ,
.Xr rabbitmq-upgrade 8 ,
.Xr rabbitmq-env.conf 5 ,
.Xr rabbitmq-echopid 8
.\" ------------------------------------------------------------------
.Sh AUTHOR
.\" ------------------------------------------------------------------
.An The RabbitMQ Team Aq Mt info@rabbitmq.com
